<%-- 
    Document   : EditarAgenda
    Created on : 16/11/2013, 21:01:42
    Author     : Eduarda
--%>

<%@page import="model.Agenda"%>
<%@page import="model.Profissional"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>        
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="css/style.css" rel="stylesheet" type="text/css" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script type="text/javascript" src="js/bootstrap.min.js"></script>
        <title>Clínica Médica - Sua saúde em primeiro lugar</title>        
    </head>
    <body>        
        <div class="container">
            <jsp:include page="cabecalho.jsp" flush="true" />       
            <div class="content">
                <div class="panel panel-default espaco-form"> 
                    <div class="row">
                        <div class="col-md-10">
                            <h3>Editar Agenda</h3>
                        </div>
                        <div class="col-md-2">
                            <a class="btn btn-success pull-right espaco-botao" href="javascript:history.back(1)" title="Voltar">Voltar</a>                    
                        </div>                        
                    </div>                      
                    <br>
                    <form method="POST" class="cadastros" action="FrontController">
                        <%Agenda agen = (Agenda) session.getAttribute("agenda");%>
                        <div class="row">
                           <div class="col-md-1">
                               <label for="informa-profissional">Profissional:</label>        
                           </div>
                           <div class="col-md-4">
                               <select class="input-text" id="informa-profissional" name="profissional" required >
                                <% 
                                 ArrayList listaProfissional = (ArrayList) session.getAttribute("listaProfissionais");                            
                                 Iterator it = listaProfissional.iterator();                            
                                 while (it.hasNext()) {
                                     Profissional pro = (Profissional) it.next();
                                     int idPessoa = pro.getPessoa().getIdPessoa();
                                     String nome = pro.getPessoa().getNome();
                                 %>                            
                                   <option value="<%=idPessoa%>"><%=nome%></option>                            
                                <% } // Fecha o while%>      
                               </select>
                           </div>
                        </div>                      
                        <input type="hidden" name="idAgenda" value="<%=agen.getIdAgenda()%>">
                        <input type="hidden" name="servlet" value="UpdateAgenda">    
                        <div class="row">
                           <div class="col-md-4">                                                           
                               <input class="input-submit pull-right button-ok" type="submit" value="Cadastrar"> 
                               <input class="input-limpar pull-right button-ok" type="button" value="Cancelar" onClick="history.back()">                                                                                       
                           </div>
                        </div>                         
                    </form> 
                </div>
            </div>  
            <jsp:include page="rodape.jsp" flush="true" />
        </div>        
    </body>
</html>
